﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace observerPatternSample
{
    public class subDisplay : iObserver, iDisplay
    {
        float num1;
        float num2;
        iSubject subjectAdd;

        public subDisplay(iSubject subjectAdd)
        {
            this.subjectAdd = subjectAdd; ;
            subjectAdd.register(this);
        }

        public void display()
        {
            Console.WriteLine("Subtracting " + num1 + " and " + num2 + " . .");
        }

        public void update(float num1, float num2)
        {
            this.num1 = num2;
            this.num2 = num2;

            display();
        }
    }
}
